<# # It is recommended to test the script on a local machine for its purpose and effects. # Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script to check if multiple folders exist under a given directory path. # Configuration Type - Computer / User # Arguments "C:\Path\To\Folder1" "D:\Path\To\Folder2" "E:\Path\To\Folder3" # Note: Based on the provided path (User Based / Computer Based), the operation can be triggered for either the computer or the user, but both actions cannot be performed simultaneously. #> # Get all arguments passed to the script $foldersToCheck = $args # Check if any arguments are passed if ($foldersToCheck.Length -eq 0) { Write-Host "No folder paths provided." exit } # Loop through each folder and check if it exists foreach ($folderPath in $foldersToCheck) { if (Test-Path -Path $folderPath -PathType Container) { Write-Host "Folder '$folderPath' exists." } else { Write-Host "Folder '$folderPath' does not exist." } }